package com.atguigu.mvc.handler;

import com.atguigu.mvc.service.EmpService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class EmpHandler {

    @Autowired
    private EmpService empService;

    private Logger logger = LoggerFactory.getLogger(this.getClass());

    public EmpHandler() {
        logger.debug("EmpHandler 构造器");
    }

    @RequestMapping("/test/auto/wired")
    public String testAutowired() {

        String message = empService.getMessage();
        logger.debug("message = " + message);

        return "target";
    }

}
